import { request } from '@/axios/index.js'

// 获取分类列表
export const getCategoryList = (data) => {
  return request.get({
    url: '/category/list',
    params: data
  })
}

// 获取所有分类列表
export const getCategoryAll = (showLoading) => {
  return request.get({
    url: '/category/all',
    showLoading
  })
}

// 更新或保存分类列表
export const saveCategory = (data) => {
  return request.post({
    url: '/category/save',
    data: data
  })
}

// 删除分类列表
export const deleteCategory = (id) => {
  return request.delete({
    url: '/category/delete/' + id
  })
}
